function template
<random>

std::operator>>

template <class charT, class traits, class UIntType,          size_t w, size_t n, size_t m, size_t r,          UIntType a, size_t u, UIntType d, size_t s,          UIntType b, size_t t, UIntType c, size_t l, UIntType f>  basic_istream<charT,traits>& operator>> ( basic_istream<charT,traits>& is,            mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>& mte );
Extract from input stream
Restores into mte the state whose textual representation is provided by is.

mte will generate the same sequence of random numbers as if equivalent invocations of operator() were performed on the object of the same type from which the provided text was obtained.

If is's fmtflags is not set to dec, the behavior of this function is undefined.

Parameters

is
istream object with its fmtflags set to dec.
The textual representation provided by is shall have been obtained by a previous call to operator<< on an ostream object of the same type with the same locale imbued.
mte
The mersenne_twister_engine object whose state is changed.

Return Value

The same as parameter is.

A call to this function may set any of the internal state flags of is if:

flagerror
eofbitThe end of the source of characters is reached during its operations.
failbitThe input obtained could not be interpreted as a valid textual representation of an object of this type.
In this case, mte preserves the parameters and internal data it had before the call.
Notice that some eofbit cases will also set failbit.
badbitAn error other than the above happened.
(see ios_base::iostate for more info on these)

Additionally, in any of these cases, if the appropriate flag has been set with is's member function ios::exceptions, an exception of type ios_base::failure is thrown.

Complexity

Linear on the state size (template parameter n).

See also